package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据openid查询用户信息
     * @param openid
     * @return
     */
    @Select("select * from user where openid=#{openid}")
    public User getUserByOpenId(String openid);

    /**
     * 新增用户
     * @param user
     */
    public void addUser(User user);

    @Select("select * from user where id=#{userId}")
    public User getById(Long userId);

    /**
     * 获取用户总量和新增用户量
     * @param map
     * @return
     */
    public Integer getUserCount(Map map);
}
